import { createBrowserRouter } from 'react-router-dom';
import MainLayout from './components/Layout/MainLayout';
import PrivateRoute from './components/Auth/PrivateRoute';
import LoginPage from './pages/login';
import SearchPage from './pages/search';
import GraphPage from './pages/graph';
import PersonalPage from './pages/personal';
import CommentsPage from './pages/comments';
import FilePage from './pages/file';

const router = createBrowserRouter([
  {
    path: '/login',
    element: <LoginPage />
  },
  {
    path: '/',
    element: <PrivateRoute><MainLayout /></PrivateRoute>,
    children: [
      {
        path: '/',
        element: <SearchPage />
      },
      {
        path: '/graph',
        element: <GraphPage />
      },
      {
        path: '/comments',
        element: <CommentsPage />
      },
      {
        path: '/personal',
        element: <PersonalPage />
      },
      {
        path: '/file',
        element: <FilePage />
      }
    ]
  }
]);

export default router;